{include file="common/header"/}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form layui-form-pane" lay-filter="form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">模型{:lang('name')}</label>
                            <div class="layui-input-inline">
                                <input type="text" name="title" lay-verify="required" placeholder="{:lang('pleaseEnter')}模型名称" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">
                                *
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">表名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="name" lay-verify="required" placeholder="{:lang('pleaseEnter')}表名"  class="layui-input">
                            
                            </div>
                            <div class="layui-form-mid layui-word-aux">
                                *
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">列表页字段</label>
                            <div class="layui-input-inline" id="tag_ids2">

                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">列表页字段</label>
                            <div class="layui-input-inline">
                                <input type="text" name="listfields" value="" placeholder="{:lang('pleaseEnter')}列表页调用字段" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">描述</label>
                            <div class="layui-input-inline">
                                <textarea name="description" placeholder="{:lang('pleaseEnter')}描述" class="layui-textarea"></textarea>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="id"  >
                                <button type="button" class="layui-btn" lay-submit="" lay-filter="demo">{:lang('submit')}</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


{include file="common/footer"/}
<script>
    layui.extend({
        selectM: 'lib/selectM/selectM',
    }).use(['jquery','layer','form','selectM'], function(){
        var $ = layui.$,selectM = layui.selectM;
        var form = layui.form;
        var info = '';
        info = {:json_encode($info)};
        form.val("form", info);

        // var tagData = [{"id":12,"name":"长者"},{"id":13,"name":"工厂"},{"id":14,"name":"小学生"},{"id":15,"name":"大学生"},{"id":16,"name":"研究生"},{"id":17,"name":"教师"},{"id":18,"name":"记者"}];
        var tagData = {$default_field|raw};
        //多选标签-所有配置
        var tagIns2 = selectM({
            //元素容器【必填】
            elem: '#tag_ids2'
            //候选数据【必填】
            ,data:tagData
            ,max:tagData.length
            //默认值
            ,selected: [12,17]
            //input的name 不设置与选择器相同(去#.)
            ,name: 'model_field'
            //值的分隔符
            ,delimiter: ','
            //候选项数据的键名
            ,field: {idName:'name',titleName:'label'}


        });
        form.on('submit(demo)',function(data){

            var formData = data.field;
            console.log('表单对象：',formData);
        })


    });

</script>